﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL
{
    public class HousesDataModel
    {
        public List<Store_House_GetHouseOrdinateAndPostTitle_Result> getHouseOrdianateAndPostTitle(int province)
        {
            HomestayWebDBEntities en = new HomestayWebDBEntities();
            return en.Store_House_GetHouseOrdinateAndPostTitle(province).ToList();
        }
        public bool CheckOridnateExisted(string ordinate)
        {
            HomestayWebDBEntities ent = new HomestayWebDBEntities();
            bool exist = false;
            var query = from h in ent.Houses
                        where h.Ordinate == ordinate
                        select h;

            if (query != null)
            {
                List<House> list = query.ToList();
                if (list.Count > 0)
                {
                    exist = true;//Existed
                }

            }
            return exist;
        }
    }
}
